import type { RouteRecordRaw } from 'vue-router';

// 定义路由类型
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    redirect: '/welcome',
    component: () => import('@/views/Home/index.vue'),
    children: [
      {
        path: '/welcome',
        name: 'welcome',
        meta: { title: '欢迎', icon: 'HomeOutlined' },
        component: () => import('@/views/Welcome/index.vue'),
      },
      {
        path: '/member',
        name: 'Member',
        meta: { title: '会员管理', icon: 'ControlOutlined' },
        children: [
          {
            path: 'ticket',
            name: 'Ticket',
            meta: { title: '会员车票', icon: 'ControlOutlined' },
            component: () => import('@/views/Member/ticket.vue'),
          },
        ],
      },
      {
        path: '/business',
        name: 'Business',
        meta: { title: '业务管理', icon: 'ControlOutlined' },
        children: [
          {
            path: 'skToken',
            name: 'SkToken',
            meta: { title: '令牌余量', icon: 'ControlOutlined' },
            component: () => import('@/views/Business/skToken.vue'),
          },
          {
            path: 'confirmOrder',
            name: 'ConfirmOrder',
            meta: { title: '订单信息', icon: 'ControlOutlined' },
            component: () => import('@/views/Business/confirmOrder.vue'),
          },
          {
            path: 'dailyTrainTicket',
            name: 'DailyTrainTicket',
            meta: { title: '余票信息', icon: 'ControlOutlined' },
            component: () => import('@/views/Business/trainTicket.vue'),
          },
          {
            path: 'dailyTrain',
            name: 'DailyTrain',
            meta: { title: '每日车次', icon: 'ControlOutlined' },
            component: () => import('@/views/Business/train.vue'),
          },
          {
            path: 'dailyTrainInfo',
            name: 'DailyTrainInfo',
            meta: { title: '每日车站', icon: 'ControlOutlined' },
            component: () => import('@/views/Business/trainInfo.vue'),
          },
          {
            path: 'dailyCarriage',
            name: 'DailyCarriage',
            meta: { title: '每日车厢', icon: 'ControlOutlined' },
            component: () => import('@/views/Business/carriage.vue'),
          },
          {
            path: 'dailySeat',
            name: 'DailySeat',
            meta: { title: '每日座位', icon: 'ControlOutlined' },
            component: () => import('@/views/Business/seat.vue'),
          },
        ],
      },
      {
        path: '/base',
        name: 'Base',
        meta: { title: '基础管理', icon: 'ControlOutlined' },
        children: [
          {
            path: 'station',
            name: 'Station',
            meta: { title: '车站管理', icon: 'ControlOutlined' },
            component: () => import('@/views/Base/station.vue'),
          },
          {
            path: 'train',
            name: 'Train',
            meta: { title: '火车管理', icon: 'ControlOutlined' },
            component: () => import('@/views/Base/train.vue'),
          },
          {
            path: 'trainInfo',
            name: 'TrainInfo',
            meta: { title: '火车车站', icon: 'ControlOutlined' },
            component: () => import('@/views/Base/trainInfo.vue'),
          },
          {
            path: 'carriage',
            name: 'Carriage',
            meta: { title: '火车车厢', icon: 'ControlOutlined' },
            component: () => import('@/views/Base/carriage.vue'),
          },
          {
            path: 'seat',
            name: 'Seat',
            meta: { title: '火车座位', icon: 'ControlOutlined' },
            component: () => import('@/views/Base/seat.vue'),
          },
        ],
      },
      {
        path: '/batch',
        name: 'Batch',
        meta: { title: '跑批管理', icon: 'FieldTimeOutlined' },
        children: [
          {
            path: 'job',
            meta: { title: '定时管理', icon: 'FieldTimeOutlined' },
            component: () => import('@/views/Batch/job.vue'),
          },
        ],
      },
    ],
  },
];

export default routes;
